import React from './node_modules/react';

const home = props => {
  const { location } = props;
  const { search } = location;
  // 专门解析url历得参数
  var urlSearchParam = new URLSearchParams(search);
  var params = {};
  for (var param of urlSearchParam.entries()) {
    params[param[0]] = param[1];
  }

  return (
    <div>
      <h2>首页</h2>
      <h3>姓名：{params.name}</h3>
      <h3>年龄：{params.age}</h3>
      <h3>工作：{params.job}</h3>
    </div>
  );
};

export default home;
